﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenExpressApp.Module.Library;
using Csla.OpenExpressApp;
using OpenExpressApp.MetaAttribute;
using OpenExpressApp.MetaModel;
using OpenExpressApp.Types;
using OpenExpressApp.WPF.Command;

namespace OpenExpressApp.Module.WPF.Command
{
    public class UserController
    {
        /// <summary>
        /// 修改用户密码
        /// </summary>
        [Command(CommandNames.ModifyUserPassword, TargetObjectType = typeof(User), Label = "设置密码", ToolbarType = ToolbarType.Main)]
        public class ModifyUserPasswordCommand : WPFViewCommand
        {
            public override bool CanExecute(ObjectView view)
            {
                return (null != view.CurrentObject);
            }
            public override void Execute(ObjectView view)
            {
                ModifyUserPasswordDialog.Execute(view.CurrentObject as User);
            }
        }
    }
}
